package com.netsdk;

import com.netsdk.common.DaHuaDevice;
import com.netsdk.utils.AutoRegister;
import com.netsdk.utils.DeviceModule;
import com.netsdk.utils.DingYue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.net.UnknownHostException;

@SpringBootApplication
public class DaHuaDeviceServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(DaHuaDeviceServiceApplication.class, args);

        //初始化sdk
        DeviceModule.init(null,null);

        //开启主动注册并登录（云部署上使用）
        try {
            AutoRegister.startAutoRegister();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        //普通登录（本地使用）
//        DaHuaDevice.login("192.168.2.66",37777,"admin","xszn123456");

        //所有设备开启订阅
        DingYue.startDingYue();
    }

}
